package function;

import db.Mp3DBRecord;

public class Mp3File {

	private String folderPath;
	private String name;
	private String rating;

	public Mp3File(String aFilePath) {
		super();
		int asIndex = aFilePath.lastIndexOf('/');
		folderPath = aFilePath.substring(0, asIndex);
		name = aFilePath.substring(asIndex + 1);
		rating = Mp3DBRecord.AVERAGE_RATING;
	}
	
	public Mp3File(String aFolderPath, String aFilename) {
		super();
		folderPath = aFolderPath;
		name = aFilename;
		rating = Mp3DBRecord.AVERAGE_RATING;
	}

	public Mp3File(String aDir, String aFilename, String aRating) {
		super();
		folderPath = aDir;
		name = aFilename;
		rating = aRating;
	}

	public String getFolderPath() {
		return folderPath;
	}

	public String getFilename() {
		return name;
	}

	public String getTitle() {
		return 	name.substring(0, name.length() - 4);
	}

	public String getFilePath() {
		return folderPath + "/" + name;
	}

	public String getRating() {
		return rating;
	}	
}
